{extend name="common:base" /}

{block name="title"}我的二手 - 天佑二手货{/block}
{block name="page"}goods{/block}

{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/css/lightbox.min.css">
{/block}

{block name="main"}
<div class="am-g am-g-fixed">
    <div class="am-u-sm-12">
        <h1 class="am-margin-top">我的二手货</h1>
        <ul class="sort am-cf">
            <li>排序规则:</li>
            <li><a id="sort-deadline" href="{:url('goods/goodsList', ['sort'=>'deadline'])}">剩余时间</a></li>
            <li><a id="sort-hits" href="{:url('goods/goodsList', ['sort'=>'hits'])}">点击量</a></li>
            <li><a id="sort-time" href="{:url('goods/goodsList', ['sort'=>'time'])}">创建时间</a></li>
            <script type="text/javascript">$('#sort-{$sort}').addClass('current');</script>
        </ul>
    </div>
    <ul class="am-avg-sm-4 goods-list">
    {volist name="data" id="vo"}
        <li class="good">
            <div class="good-box">
                <h4 class="am-text-truncate" title="{$vo.title}">{$vo.title}</h4>
                {if condition="$vo.thumb"}
                <a href="__ROOT__{$vo.thumb}" title="{$vo.title}" data-lightbox="group-{$vo.good_id}">
                <div class="thumb" style="background-image: url(__ROOT__{$vo.thumb|default='/static/images/no-thumb.png'})">
                    {if condition="$vo.expand.photos_count gt 1"}
                    <span class="am-badge am-badge-success badge">{$vo.expand.photos_count}</span>
                    {/if}
                </div>
                </a>
                {volist name="$vo.expand.photos" id="photo" key="pindex"}
                    {if condition="$pindex neq 1"}
                    <a class="am-hide" title="{$vo.title}" href="__ROOT__{$photo}" data-lightbox="group-{$vo.good_id}"></a>
                    {/if}
                {/volist}
                {else /}
                <div class="thumb" style="background-image: url(__ROOT__{$vo.thumb|default='/static/images/no-thumb.png'})">
                    {if condition="$vo.expand.photos_count gt 1"}
                    <span class="am-badge am-badge-success badge">{$vo.expand.photos_count}</span>
                    {/if}
                </div>
                {/if}
                <p class="deadline">剩余时间: {$vo.deadline|get_time_diff} <a class="operate" href="#">续期</a></p>
                <p class="other">
                    <span class="am-margin-right price" title="{$vo.price} 元">
                        <i class="am-icon am-icon-cny"></i> {$vo.price}
                    </span>
                    <span class="am-margin-right hits" title="{$vo.hits} 人看过">
                        <i class="am-icon am-icon-eye"></i> {$vo.hits}
                    </span>
                    <span class="operate am-fr">
                        <a href="#" title="修改信息"><i class="am-icon am-icon-gear"></i></a>
                    </span>
                </p>
            </div>
        </li>
    {/volist}
    </ul>
    {$data->render()}
</div>
{/block}

{block name="js"}
<script src="__STATIC__/js/lightbox.min.js"></script>
{/block}